<template>
  <el-container>
    <el-header>

    </el-header>
    <el-container>
      <el-aside>
        <menu-view :menu="menu"></menu-view>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// @ is an alias to /src

import MenuView from '@/components/MenuView.vue'
export default {
  name: 'HomeView',
  data(){
    return {
      menu:[]
    }
  },
  components: {
    'menu-view':MenuView
  },
  created(){
    this.$axios({
      url:"/api/menu/list",
      method: 'get',
    })
    .then(res=>{
      console.log(res);
      if (res.data.code === 0) {
        this.menu = res.data.data;
      } else {
        alert("请求后台失败")
      }
    })
  }

}
</script>
<style lang="less" scoped >


</style>